Computerized databases are used in many enterprises to maintain accurate and consistent data while enabling easy retrieval and modification of that data. The data is stored electronically in records on data storage devices such as a disk or other direct access storage device (DASD) attached to a computer system. The computer system has memory and a central processing unit (CPU) which runs database management system (DBMS) software.
The DBMS manages access to and processing of the database. The database can be accessed to retrieve data or to update data through a series of commands issued by a database user. The DBMS processes each command entered by a user as a separate "transaction". A single update transaction typically consists of a number of changes to be made to a series of database records (for example, updating new manager information for each employee of a manager). When all of the changes have been successfully made to the database records, the transaction is considered to be "committed". Records of each change to be made to database records can be recorded in a log which can be used to reproduce or recover the database in the event of a system or media failure. The log can be stored on an auxiliary storage device such as DASD or tape.
Enterprises that rely on computerized databases require continuity of service in the event of a system failure. Because computer systems are susceptible to hardware and software failure which can impair access to the data, there is a need to ensure that update transactions being processed when a failure occurs are accurately recorded.
Database media recovery processing includes the well-known forward recovery process in which a database unit is reconstructed by updating an earlier version with recovery data recorded in a log. A copy of the original version of the database unit is saved in stable storage. When a failure destroys the current copy of the database, the last current version of the database unit is reconstructed by restoring the saved version and then applying the log changes to the saved version in the same order in which they were made to the lost version.
A replica of a database can be stored at a remote location in order to reduce the chances of both systems being down at the same time due to a disaster at one of the sites. Use of forward asynchronous recovery in distributed database mirrors the original transaction processing. Changes to the primary database are logged and applied in the same sequence in which they occurred.
Many DBMSs are based on a hierarchical approach to database management. One such system is the IMS software product from IBM. The Fast Path feature of IMS is particularly well-suited for "on-line systems" driven by commands entered directly by end users such as bank tellers. These systems involve a high volume of commands being issued to the database that need to be processed quickly. A Fast Path database can be subdivided into 240 independent areas corresponding to an area of a disk on which the database is stored. One disk can correspond to one area.
In order to economize on memory requirements, the Fast Path system does not have what is called a look-aside database buffer pool which is used in many other IMS databases. A look-aside buffer is an area of the computer memory where data transferred from the external storage device can be kept temporarily so that it can be accessed more quickly during database searches. One or more pages of memory stay in the buffer for extended periods of time and subsequent changes to records in those pages are made directly to the buffer without writing the changes to the stable storage. Eventually, the pages of memory are returned to the corresponding storage sector in the stable storage. A buffer handler using a look-aside facility reduces its I/O requirements. However, the shared buffer pool has a disadvantage in terms of space utilization efficiency, particularly, in cases where the updated portion is very short compared with the database block.
Another difference of the Fast Path database from other IMS databases is that it does not log both a before image of a database record to be updated (called an "undo" record) and an after image of the changes to be made to the database as part of a transaction (called a "redo" record). This is done in order to increase efficiency when processing user commands. When using undo records, the DBMS writes the redo records as received. If a transaction is not committed, the DBMS uses the undo records to rewrite the record back to the way the record was before it had been changed (as saved by the undo record). The Fast Path system does not need to save undo records, since, it only writes the redo records at commit time, and then writes all changes to the disk.
Restart processing for the Fast Path database consists of using redo log records to finish database disk writes that did not occur because of the failure.
In order to ensure consistency between a Fast Path database and its replica, processing of the primary database should be reflected in the replica database. Throughput for application of record processing to the replica should be at least as good as that achieved by the transaction processing system for the primary database. Resource consumption at the replica processing must be low relative to the consumption of the transaction processing system as a whole. Serialization is needed to ensure that the database is transaction consistent with and identical to the primary database. Availability to the primary database cannot be reduced by the addition of transaction processing for the replica. Therefore, the I/O operations for writing changes to the backup databases must be made efficiently.
There are problems with replicating databases due to the need for providing availability to the active sites and with performance where a significant number of messages must be exchanged for each transaction. There is a high cost in terms of memory and time requirements associated with database serialization techniques such as locking for handling the processing of the records used to replicate the active databases. Therefore, it is advantageous to avoid using serialization techniques while maintaining the integrity of the databases. Additionally, efficiency in I/O operations are particularly important for a backup system which does not use a look-aside buffer.
In pending U.S. patent application Ser. No. 07/411,729 now U.S. Pat. No. 5,170,480 assigned to the assignee of this patent application, change processing of a replica database is accomplished by separating redo records obtained from the transaction log of a primary database into respective queues. The redo records are separated such that all transaction records for a unit of transfer of the primary database are placed on the same queue in log sequence. The redo records are distributed onto the queue based on a hashing function which randomly assigns the redo records onto queues.
The database replication method is particularly well-suited for a database system that uses a "look-aside buffer", where data from the disk storage device is kept for significant periods of time and repeatedly changes are made to the data in the buffer without writing the changes to the disk. Because the Fast Path database system does not have a look-aside buffer, it is more important for that system to be efficient with I/O operations when updating the database.